package com.aaa.vegetablemarketexpress.controller;

import com.aaa.vegetablemarketexpress.entity.OperLog;
import com.aaa.vegetablemarketexpress.service.OperateService;
import com.aaa.vegetablemarketexpress.util.Page;
import com.aaa.vegetablemarketexpress.util.Result;
import com.aaa.vegetablemarketexpress.util.ResultUtil;
import com.github.pagehelper.PageInfo;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @FileName: OperateLogController
 * @Description:
 * @Author: 张钰哲
 * @CreateTime: 2025/9/20 15:33
 * @Version: 1.0.0
 */
@RestController
@RequestMapping("operateLog")
public class OperateLogController {
    @Resource
    private OperateService operateService;
    @PostMapping("selectOperLogList")
    public Result selectOperLogList(@RequestBody Page<OperLog> page) {
        PageInfo<OperLog> operLogPageInfo = operateService.selectOperLogList(page);
        return ResultUtil.success(operLogPageInfo);
    }
    /**
     * 根据年月查询echats图表展示数据
     * @param yearMonth
     * @return
     */
    @GetMapping("queryEchartsDataByYearMonth")
    public Result queryEchartsDataByYearMonth(String yearMonth) {
        return ResultUtil.success(operateService.queryEchartsDataByYearMonth(yearMonth));
    }

}
